package com.orhon.smartcampus.modules.baseinfo.mm;


import com.orhon.smartcampus.modules.base.gqlModel.GQLDictionary;
import com.orhon.smartcampus.modules.base.mm.LangMapper;
import com.orhon.smartcampus.modules.baseinfo.entity.SchoolcalendarDay;
import com.orhon.smartcampus.modules.baseinfo.entity.SchoolcalendarWeek;
import com.orhon.smartcampus.modules.baseinfo.gqlModel.GQLSchoolCalendarDay;
import com.orhon.smartcampus.modules.baseinfo.gqlModel.GQLSchoolCalendarWeek;

import java.util.List;

import org.mapstruct.InheritConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Named;
import org.mapstruct.factory.Mappers;

@Mapper(uses = {
        LangMapper.class
})
public interface SchoolCalendarWeekMapper {

    SchoolCalendarWeekMapper MAPPER = Mappers.getMapper(SchoolCalendarWeekMapper.class);

    @Mapping(source = "id" , target = "id")
    @Mapping(source = "month" , target = "month", qualifiedByName = "dictionary")
    @Mapping(source = "semesterId" , target = "semester_id")
    @Mapping(source = "yearCode" , target = "year_code")  
    @Mapping(source = "weekSort" , target = "week_sort")  
    @Mapping(target = "days" , ignore = true)
    GQLSchoolCalendarWeek toSchoolcalendarWeek(SchoolcalendarWeek entity);
    
    @InheritConfiguration(name = "toSchoolcalendarWeek")
    List<GQLSchoolCalendarWeek> toSchoolcalendarWeekList(List<SchoolcalendarWeek> entities);
    
    @Named("dictionary")
    default GQLDictionary convertDictionary(Integer pid){
        return new GQLDictionary();
    }

}
